Skip to content

Conversation

JPRuskin
Copy link
Member

@JPRuskin JPRuskin commented Oct 4, 2022

Description Of Changes

This PR adds a delightful new command, choco license.

It should offer read and write, but at the moment just offers a basic output of the current license.

It doesn't yet have tests, either.

Motivation and Context

This has been requested by awesome folk!

Testing

  1. We have tested it locally

Change Types Made

  • Bug fix (non-breaking change)
  • Feature / Enhancement (non-breaking change)
  • Breaking change (fix or feature that could cause existing functionality to change)
  • PowerShell code changes.

Related Issue

Fixes #2829

Change Checklist

  • Requires a change to the documentation
  • Documentation has been updated
  • Tests to cover my changes, have been added
  • All new and existing tests passed.
  • PowerShell v2 compatibility checked.

@coveralls
Copy link

coveralls commented Oct 4, 2022

Coverage Status

Coverage remained the same at 27.501% when pulling f842a18 on JPRuskin:license-command into e35fe2b on chocolatey:develop.

Copy link
Member

@AdmiringWorm AdmiringWorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a WIP. Just commenting on a few things I noticed.

@gep13
Copy link
Member

gep13 commented Jun 3, 2025

@JPRuskin @corbob unless there are any objections, I am going to take the liberty of making some changes/updates to this PR.

@gep13 gep13 force-pushed the license-command branch 3 times, most recently from 13235a5 to a22d727 Compare June 3, 2025 08:24
@gep13 gep13 changed the title (#2829) Adds Basic choco license Command (WIP) (#2829) Adds Basic choco license Command Jun 3, 2025
@gep13 gep13 force-pushed the license-command branch from a22d727 to 15d6a93 Compare June 4, 2025 07:46
@gep13
Copy link
Member

gep13 commented Jun 4, 2025

@JPRuskin @corbob I have finished doing an overhaul of this PR. This changes that I have made include:

  • rebased on head of develop, and changed to new way of doing things for Obsolete methods
  • added unit tests for LicenseCommand
  • added Pester testsed for choco license invocation
  • added parsing of subcommands, with a default to use choco license info - this was after a conversation with Paul, where it was decided that info was the appropriate default, rather than say list or get.
  • switched to using Regex for parsing allowed Node Count from license, as this is inkeeping with how it is done elsewhere in products
  • added help output from choco license -h
  • switched DryRun to call Run, since this is inkeeping with what choco support command currently does
  • changed string.Format output of DateTime to use universally recognised format strings, also don't include time in the output, as this doesn't really help
  • added concept of LicenseCommandType to ChocolateyConfiguration, which allows for future expansion of LicenseCommand with additional subcommands

Let me know if either of you have any questions.

@gep13 gep13 force-pushed the license-command branch from 15d6a93 to b021a4a Compare June 4, 2025 07:54
@gep13 gep13 requested review from AdmiringWorm and corbob June 4, 2025 08:12
@gep13 gep13 marked this pull request as ready for review June 4, 2025 08:19
@gep13 gep13 force-pushed the license-command branch from 86cdc03 to 4e8ddb3 Compare June 4, 2025 14:25
@gep13 gep13 requested review from gep13, corbob and AdmiringWorm June 4, 2025 14:26
@gep13 gep13 force-pushed the license-command branch 6 times, most recently from 845a777 to 9c63d9b Compare June 5, 2025 15:54
@gep13 gep13 force-pushed the license-command branch from 9c63d9b to 4b5efe5 Compare June 5, 2025 15:57
@gep13
Copy link
Member

gep13 commented Jun 5, 2025

@AdmiringWorm this should be ready for a final review now. I have fixed up the unit test that was failing as a result of the change that was made to the docs.

JPRuskin and others added 3 commits June 6, 2025 13:22
This commit introduces a new command to Chocolatey, `license`.

Currently, the functionality is limited, and it will only
display details on the current license.
Not really the best thing to use as a test string.  Let's use"abc"
instead.
As a result of the overhaul of the wording for this command, we missed
getting the pester test updated to use the correct wording.

This PR addresses that oversight.
@gep13 gep13 force-pushed the license-command branch from 983ea95 to 55011ab Compare June 6, 2025 12:22
Copy link
Member

@AdmiringWorm AdmiringWorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AdmiringWorm
Copy link
Member

Great work on getting this added and updated @JPRuskin and @gep13. Just waiting on the builds to finish, then we can get this merged.

@AdmiringWorm
Copy link
Member

We'll ignore the docker build for now, it is exhibiting the same issues that happens from time to time when it comes with SSL connections, and since the ubuntu and windows build succeeded, we have the ones we want at the moment.

@AdmiringWorm AdmiringWorm merged commit 46079f4 into chocolatey:develop Jun 6, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add choco license command
5 participants